package com.tuanzi.loan.business.service.settlement.impl;

import com.tuanzi.loan.business.entity.settlement.ProductLinkInfo;
import com.tuanzi.loan.business.repository.settlement.ProductLinkInfoRepository;
import com.tuanzi.loan.business.service.settlement.ProductLinkInfoService;
import com.tuanzi.loan.core.aspect.Debug;
import com.tuanzi.loan.core.repository.JPAAuditRepository;
import com.tuanzi.loan.core.service.BaseAuditServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.retry.RetryException;
import org.springframework.retry.annotation.Retryable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @author caiwanlin
 * @create 2018-01-12 11:32
 */
@Debug
@Service
@Transactional
@Retryable(value = { RetryException.class })
public class ProductLinkInfoServiceImpl extends BaseAuditServiceImpl<ProductLinkInfo,Long> implements ProductLinkInfoService{
    @Autowired
    private ProductLinkInfoRepository productLinkInfoRepository;

    @Override
    protected JPAAuditRepository<ProductLinkInfo, Long> getRepository() {
        return productLinkInfoRepository;
    }

    @Override
    public List<ProductLinkInfo> findAllByCompanyId(Long companyId) {
        return productLinkInfoRepository.findAllByCompanyId(companyId);
    }
}
